package lesson4.tests;

import lesson4.api.base.TestBase;
import lesson4.api.models.UserModel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;


public class IndexPageTests extends TestBase
{
	// Logger
	private static Logger log = LoggerFactory.getLogger(IndexPageTests.class);

	public void loginTest(String p_username, String p_password, boolean p_expectedResult)
	{
		log.info("Start login test");
		UserModel userData = new UserModel();
		userData.login = p_username;
		userData.password = p_password;

		navigation().toIndexPage().login(userData);

		Assert.assertEquals(page().isLoggedIn(), p_expectedResult, "Test failed");
	}

}